#ifndef DLGDATAEDIT_H_
#define DLGDATAEDIT_H_

#include "scHeader.h"
#include <QDialog>
#include <QSignalMapper>
#include <QLineEdit>
#include <QFormLayout>
#include <QDialogButtonBox>

namespace sybilpm
{

class DlgDataEdit : public QDialog
{
	Q_OBJECT
public:
	DlgDataEdit(PkType entityId, PkType pk, QWidget *parent);
	~DlgDataEdit();
public slots:
	void fillComboBoxSl(unsigned long transactionId);

public slots:
	virtual void accept();

private slots:
	void pickValueSl(int col);
	void isModifiedSl();

private:
	typedef std::map<unsigned int, QWidget *> AttrMap; // map DM-column to widget
	const DataTable & dt;
	PkType pk;
	unsigned long transId;
	QSignalMapper *pickMapper;
	QVBoxLayout *verticalLayout;
	QGridLayout *gridLayout;
    QPushButton *butOk;
    QPushButton *butCancel;
	AttrMap attrMap;
	TimeType deadl;
	bool cBoxFilled, ignoreModify;
	QDateTimeEdit * dtIks, *dtIks_;
};

} // namespace sybilpm

#endif /*DLGDATAEDIT_H_*/
